<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>信息显示</title>
<script src="libs/jquery-1.12.1.min.js"></script>
<script type="text/javascript" src="libs/getQueryString.js" ></script>
<link href="libs/css/bootstrap.min.css" rel="stylesheet">
<script src="libs/bootstrap.min.js"></script>
<script src="libs/handlebars.min.js"></script>
<script src="libs/dropzone.js"></script>
<script src="libs/css/dropzone.css"></script>
<script src="libs/jquery.backstretch.min.js"></script>
</head>
<body>
<nav class="navbar navbar-default">
	<div class="container-fluid">
		<!-- Brand and toggle get grouped for better mobile display -->
		<div class="navbar-header">
			<a class="navbar-brand" href="homepage.html">用户  _<span id="nickname"></span></a>
		</div>

		<!-- Collect the nav links, forms, and other content for toggling -->
		<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
	      <ul class="nav navbar-nav">
	        <li ><a href="homepage.html">首页 <span class="sr-only">(current)</span></a></li>
	        <li><a href="#">Link2</a></li>
	        <li class="dropdown">
	          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">档案管理 <span class="caret"></span></a>
	          <ul class="dropdown-menu">
	            <li><a href="archiveadd.html">添加档案</a></li>
	            <li><a href="#">删除档案 </a></li>
	            <li role="separator" class="divider"></li>
	            <li><a href="#">查看档案</a></li>
	            <li role="separator" class="divider"></li>
	            <li><a href="#">One more separated link</a></li>
	          </ul>
	        </li>
	      </ul>
	      
	      <form class="navbar-form navbar-left" role="search">
	        <div class="form-group">
	          <input type="text" class="form-control" placeholder="档案号或者ID" id="arc_id">
	        <button type="submit" class="btn btn-default" id="hpbut">查询</button>
	        </div>
	      </form>
	      
	      <ul class="nav navbar-nav navbar-right">
	        <li><a href="#">Link3</a></li>
	        <li class="dropdown">
	          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">用户操作 <span class="caret"></span></a>
	          <ul class="dropdown-menu">
	            <li><a href="#">更换用户名</a></li>
	            <li role="separator" class="divider"></li>
	            <li><button type="button" class="btn btn-link" id="quit">用户退出</button></li>
	          </ul>
	        </li>
	      </ul>
		</div><!-- /.navbar-collapse -->
	</div><!-- /.container-fluid -->
</nav>
<div class="container-fluid" >

<div class="col-lg-2">
  <!-- Nav tabs -->
  <ul class="nav nav-pills nav-stacked" role="tablist">
    <li role="presentation" >
       <a href="#home" aria-controls="home" role="tab" data-toggle="tab">档案信息</a></li>
    <li role="presentation" >
       <a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">图片</a></li>
    <li role="presentation">
       <a href="#messages" aria-controls="messages" role="tab" data-toggle="tab">上传</a></li>
  </ul>
  </div>


  <!-- Tab panes -->


<div class="col-lg-8 col-lg-offset-2">
  <div class="tab-content">
    <div role="tabpanel" class="tab-pane " id="home">
	    <table border="1">
			<tr><td>ID</td><td><span id="id"></span></td></tr>
			<tr><td>档案号</td><td><span id="archive_id"></span></td></tr>
			<tr><td>身份号</td><td><span id="identity"></span></td></tr>
			<tr><td>姓名</td><td><span id="name"></span></td></tr>
			<tr><td><input type="button" id="update" value="修改">
			<input type="button" id="del" value="删除" ></td></tr>
		</table>
    </div>
	<div role="tabpanel" class="tab-pane" id="profile"> 
		<div  id="profile1"></div>
	</div>
	<div role="tabpanel" class="tab-pane" id="messages">
	<!-- <form  action="" method="post" enctype="multipart/form-data" id="form">
				      <input type="file" name="file" />
				      <button type="submit">上传</button>
				      </form> -->
	<form id="dropzone" action="" class="dropzone" method="post"></form>
	    
	</div>
</div>
</div>	
</div>
	
<script type="text/javascript">
$.backstretch("picture/5.jpg")
</script>

<script id="template" type="text/x-handlebars-template">
    {{#each item}}
			<img src="upload/{{archive_id}}/{{name}}" />
    {{/each}}
</script>
<script type="text/javascript">
$(function(){
	var id=getQueryString('id');
	
	$.getJSON('One.action?id='+id,function(res){
		$('#id').text(res.id);
		$('#archive_id').text(res.archive_id);
		$('#identity').text(res.identity);
		$('#name').text(res.name);
	});
	$('#del').click(function(){
		$.getJSON('del.action',{
			id : id
		},function(res){
			if(""==res){
				window.location.href='homepage.html';
			}
		});
	});
	$.getJSON('query_file.action?id='+id, 
		function(res) {
			var data={'item':res};
			var t=Handlebars.compile($('#template').html());
			$('#profile1').html(t(data));
	});
	$.getJSON('querynn.action',function(res){
		console.log(res);
		$('#nickname').text(res.nickname);
	});
	$('#quit').click(function(){
		$.post('quit.action',{
		},function(res){
			if("quit"==res){window.location.href='login.html';}
		});
	});

});
</script>
<script type="text/javascript">
	var id = getQueryString('id');
	Dropzone.options.dropzone = {
		url : id + '/upload.action',
		clickable : true,
		acceptedFiles : '.jpg',
		dictDefaultMessage : '拖放图片文件到此位置',
		dictInvalidFileType : '错误的文件类型',
		dictFileTooBig : '文件过大',
		dictResponseError : '与服务器连接失败',
		dictCancelUpload : '已取消',
		dictCanceluploadConfirmation : '确认取消上传'
	}
</script>
</body>
</html>





	

	


